home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 001 / zcexe487.arc / PHODIR.T < prev    next >
Encoding:
Text File  |  1987-04-25  |  21.2 KB  |  615 lines

  1.     ::rev 04-21-87 for ZCOMM
  2.     cls; goto cmdch
  3. ak    lput "\r\n\E[1;5mType space to Continue\E[m"; if y
  4.     lput "\E[2A\E[2K"
  5. busy    speed 1200 putw "ATM0H1\r"
  6. reset    speed 1200; putw "ATZ\r";pat 1 OK; wait -f3
  7. twx    if twxout speed 1200 %s8 f -qxh twxout;o
  8.     else echo " No file to Send. "
  9. tryd    %telno
  10. dial    pat; pat 0 K\r\n; ena -d
  11.     bye
  12.     put "ATZ\r"; wait -f3; if !0 wait -f3
  13.     if !0 echo "Initializing MODEM"; br; sleep 60; put "ATZ\r"; wait -f5
  14.     if !0 put "AT E1 Q0 S7=60 V1\r"; wait -f3
  15.     if "!0&&S>1201" speed 1200 put "ATZ\r"; wait -f3; if !0 wait -f3
  16.     if "!0&&S>301" speed 300 put "ATZ\r"; wait -f3; if !0 wait -f3
  17.     if !0 put "AT E1 Q0 S7=60 V1\r"; wait -f3
  18.     if !0 echo "No response From MODEM"; pat; fail
  19.     sleep 4
  20.     put "ATS6=5 S8=4 S0=0\r" wait -f2
  21.     pat 0c ";"
  22.     dis -d
  23.     put %mprefix; putw %telno\r
  24.     if 0 wait -f30; echo "Hit SPACE to Hang Up"; return
  25.     pat 9l OK
  26.     pat 1 "CONNECT\r"; pat 2i "NO CARRIER"; pat 3 "BUSY"; pat 4 RING;
  27.     pat 5 "ECT 12"; pat 6 "ECT 24"; pat 7 "CONNECT FAST"
  28.     pat 8 "NO DIAL TONE"; pat 10 "CONNECT 300"
  29.     wait -f60
  30.     while "4&&!L>3" wait -f20
  31.     if "1||10" sp 300 pat; return
  32.     if 5 sp 1200 pat; return
  33.     if 6 sp 2400 pat; return
  34.     if 7 sp 19200 pat; return
  35.     if !9 bye
  36.     pat; fail
  37. askspd    lput "1200 baud?"; if y sp 1200; return
  38.     lput "2400 baud?"; if y sp 2400; return
  39.     lput "4800 baud?"; if y sp 4800; return
  40.     lput "9600 baud?"; if y sp 9600; return
  41.     lput "19200 baud?"; if y sp 19200; return
  42.     lput "300 baud then."; sp 300; return
  43. callcis    speed 1200
  44.     if %s3 sets telno %s3; gosub tryd; if c sleep 20 put \3 return
  45.     speed 300
  46.     if %s2 sets telno %s2; gosub tryd; if c sleep 20 put \3 return
  47.     sp 1200
  48.     if %s5 sets telno %s5; gosub tryd; if c gosub tym12; return
  49.     if %s4 sets telno %s4; gosub tryd; if c gosub tel12; return
  50.     echo "Sorry, none of the numbers are working right now"
  51.     gosub ak
  52.     fail
  53. tel12    pat 1 TERMINAL
  54.     while "c&&!1" put "\r" wait -f2
  55.     if !c fail
  56.     pat 1 @
  57.     put "D1\r"; wait -f40
  58.     if !c fail
  59.     if !1 o fail
  60.     put "C 202202\r"
  61.     return
  62. tym24    wait -f5
  63.     in !c fail
  64.     put A pat 1 "log in"; wait
  65.     put "%s1\r"; return
  66. tym12    pat 1 x; wait
  67.     if !c fail
  68.     put A pat 1 "log in"; wait
  69.     if !c fail
  70.     put "%s1\r"; return
  71. xsetup    port 1; : if !c speed 1200 putw "ATZ\r"
  72.     pd1; pz480    : turn on time stamping, set PST timezone
  73.     set mprefix ATDP    : Pulse Dial
  74.     : set mprefix ATDT    : Tone Dial
  75.     set mcommand "gosub dial"
  76.     set l "1"; set m "1"
  77.     set answerback "\r\nYOUR NAME CITY\r\n\21"
  78.     : ps8 :set C/G status line attribute to dim
  79.     : set phones "c:/phones.t"
  80.     echo "Resetting Function Keys"; reskeys
  81.     set f3 @rb;  set f4 "@echo Working...;  gosub tlearn"
  82.     set f6 "@accept s2 Receive-File: rc %s2"
  83.     set f7 "@accept s1 Send-File: sx %s1"
  84.     set f8 "\PXXXXX"
  85.     : accept xpassword "\E[mMaster Password: \E[8m"; lput "\E[m"
  86.     if fyamhelp.t set helpfile "yamhelp.t"; set f10 "@help"
  87.     if f/zmanh.hlp set helpfile "@yhp /zmanh.hlp"; set f10 "@help"
  88.     if fzmanh.hlp set helpfile "@yhp zmanh.hlp"; set f10 "@help"
  89.     set f11 "@find speed %phones"
  90.     set f12 "@accept s1 Name:; find \n%s1 %phones"
  91.     set f13 "@find \\\;\r %phones"
  92.     set f14 "@speed 1200 putw ATH\r"
  93.     : display bell=visual
  94.     set emdir /memo; set twxfile twx;
  95.     : set call1 ATZ\r\336ATZ\r
  96.     set call2
  97. @bye; sleep 3; putw "\336ATZ\r\336\336ATX1 M0 S0=1\r"; clears; ena -8n
  98.     : (AT commands above are repeated to make sure modem obeys them)
  99.     : set callpath /tmp/*.xx?
  100.     set outahost
  101. @bye; putw "ATZ\r"
  102.     : set calllog c:/calllog
  103.     : set rxlog c:/tmp/rxlog
  104.     : set txlog c:/tmp/txlog
  105.     : set tmp /yam/tmp
  106.     : set lib /yam/lib
  107.     set quitcmd \003\336off\r
  108.     if dc ps4 pn2 pr97    :if RGB, green+red stat+color rev video
  109.     return
  110. setup    echo "Running ..."
  111.     if dg>10000 return
  112.     p-1; set mcommand "gosub dial"
  113.     if da>1 goto setu1
  114.     if !flocal.t gosub sinit; gosub .local.t; goto setu1
  115.     gosub .local.t
  116.     echo "Hello %s6 %s7."
  117.     lput "Has your phone number info changed since the\r\n"
  118.     lput "last time you entered your name (y/n) ?"
  119.     if y del local.t; gosub sinit; gosub .local.t
  120. setu1:    set s9 "";  if du goto setu3
  121.     set s9 "1"
  122.     pd1; pz480
  123.     pe0; lput "Checking COM1 ..."; port 1; if e pe0; port 2; set s9 "2"; goto cm1
  124.     if c echo " I Detect CARRIER on COM1. "; gosub carrier; if is9,x goto setu3
  125.     if is9,y goto cm2
  126.     sp 300 mput "ATZ\r" sleep 4 pe0; if !m put "AT E1 Q0 V1\r"; sleep 6; pe0
  127.     if m goto setu3
  128.     if !m pe0; lput "Checking COM2 ..."; port 2; set s9 "2";if e goto cm3
  129. cm1:    if c echo " I Detect CARRIER on COM2. "; gosub carrier; if %s9 goto setu3
  130. cm2:    if !c sp 300 mput "ATZ\r" sleep 4; if !m put "AT E1 Q0 V1\r"; sleep 6
  131.     pe0
  132. cm3:    if "!c&&!m||e" echo "WARNING: No Modem detected on Port 1 or 2!"; port 1
  133. setu3:    pe0
  134.     set f3 @rb;  set f4 "@echo Working...;  gosub tlearn"
  135.     set f5 "@accept s1 Send-File(s): sz %s1"
  136.     set f6 "@accept s2 Receive-File: rc %s2"
  137.     set f7 "@accept s1 Send-File: sx %s1"
  138.     set f8 "\PXXXXX"
  139.     set f11 "@find speed %phones"
  140.     set f12 "@accept s1 Name:; find \n%s1 %phones"
  141.     set f13 "@find \\\;\r %phones"
  142.     set f14 "@speed 1200 putw ATH\r"
  143.     if fyamhelp.t set helpfile "yamhelp.t"; set f10 "@help"
  144.     if f/zmanh.hlp set helpfile "@yhp /zmanh.hlp"; set f10 "@help"
  145.     if fzmanh.hlp set helpfile "@yhp zmanh.hlp"; set f10 "@help"
  146.     if da>1 return
  147.     : return : uncomment this line to remove automatic menu startup
  148.     sets menu %phones
  149.     cls; goto cmdch
  150. demo    cls
  151. cmdch:    echo " ZCOMM Beginner's Menu "
  152.     display nlmode nooverstrike
  153.     lput "\nc  Compuserve Online Demo (requires modem)\n"
  154.     lput "d  Dial telephone number and connect\n"
  155.     lput "f  Flash-up HELP Processor\n"
  156.     lput "g  Go Local (Direct Connection)\n"
  157.     lput "h  Host Operation demo (dial-in)\n"
  158.     lput "l  List file names in current directory\n"
  159.     lput "n  Newest files listed first\n"
  160.     lput "o  Display Ordering Information\n"
  161.     lput "r  Review (circular buffer search/cut/paste) demo\n"
  162.     lput "s  Generate a script with AI \E[1mTurboLearn Script Writer\E[m\n"
  163.     lput "t  Call Telegodzilla (Omen's Software Downloading System)\n"
  164.     lput "u  Utility command demo\n"
  165.     lput "v  Voice call to Omen Technology (requires modem)\n"
  166.     lput "x  eXit to DOS\n"
  167.     lput "z  exit to ZCOMM command prompt\n\n"
  168.     display nonlmode
  169. choos:    acceptl1 s1 "Please enter your menu choice "
  170.     if is1,c call cidemo; cls; goback cmdch
  171.     if is1,d call xdnum; cls; goback cmdch
  172.     if is1,f help; goback cmdch
  173.     if is1,g call glocal; cls; goback cmdch
  174.     if is1,h gosub host; host; return
  175.     if is1,l dirr; goback choos
  176.     if is1,n dirt; goback choos
  177.     if is1,o gosub order; goback choos
  178.     if is1,r kill; gosub review; goback choos
  179.     if is1,s echo "Working...";  gosub tlearn; acceptl1 s0 "Hit Enter ";  goback cmdch
  180.     if is1,t call telegodzilla; cls; goback cmdch
  181.     if is1,u gosub udemo; cls; goback cmdch
  182.     if is1,v call caf; if y||df putw "ATZ\r"; goback choos
  183.     if is1,x x
  184.     if is1,y goto quitt
  185.     if is1,z goto quitt
  186.     cls; echo "Unknown Command"; goback cmdch
  187. udemo:    cls;  echo "Enabling debug output to show the commands"; pv4
  188.     echo "The find command searches files for a string, case insensitive"
  189.     find zcom *.t
  190.     gosub ak
  191.     echo "The sum command calculates file checksum compatible with Unix"
  192.     sum local.t
  193.     gosub ak
  194.     echo "Word Count: lines, words, printing characters, and characters"
  195.     echo "The count of printing characters predicts ribbon usage!"
  196.     wc *.t
  197.     gosub ak
  198.     echo "The chek command calculates a 16 bit file CRC useful for comparing"
  199.     echo "Multiple copies of the same file for accurcacy and identity."
  200.     chek local.t
  201.     gosub ak
  202.     cls
  203.     echo "Paced upload transmission demonstration"
  204.     echo "File Upload pacing is used with bulletin boards, etc."
  205.     echo "Note the EXTRA delay at the end of each line"
  206.     display nooverstrike
  207.     open %phones
  208.     echo "Let's just send a little bit from the END of the file"
  209.     seek -120
  210.     ph2; o; t -adhxtp
  211.     close; pv0; dis -dah
  212.     gosub ak
  213.     return
  214.  
  215. 73    speed 1200 %l-603-924-9809 t
  216. amrad-bbs    speed 300 %l-703-734-1387 t
  217. amsat-bbs    speed 300 %l-512-852-8194 t
  218. caf        speed 1200 %s8-3406\;
  219. cidemo    speed 1200 set s1 "cis02"; gosub callcis
  220.     pat 0 OK;
  221.     pat 1i ID:
  222.     pat 4 "?? LOG"
  223.     pat 5 "DISCONNECTED"
  224.     pat 2 "please log in: "
  225.     pat 5i "more !"
  226.     pat 6$ "!"
  227.     pat 7i "continue!"
  228.     wait;  put 77770,101\r
  229.     pat 1i assword:; wait; if !1 goto cid2
  230.     echo "Sending PASSWORD"; put FREE-DEMO\r
  231.     wait
  232. cid2:    if "5||2" echo " Login may be possible through a Compuserve Node "
  233.     if "1||4||5||2" echo " Try Again Later "; o; sleep 50; return
  234.     pat;
  235.     pat 1i "menu !"
  236.     pat 2i "page !"
  237.     pat 3i "choice !"
  238.     pat 4i "continue!"
  239.     pat 5i "more !"
  240.     pat 6$ "!"
  241.     put \25s\r
  242.     wait put "\025t\r"
  243.     wait put "\0253\r"
  244.     wait put "\025s 1\r"
  245.     wait put "\025off\r"
  246.     echo "Good Bye Cruel World"
  247.     close
  248.     o
  249.     gosub review
  250.     return
  251. review    if !fcdemo echo "Sorry, the file \"cdemo\" is missing."; return
  252.     kill; read cdemo
  253.     del cut
  254.     <revv
  255.     review
  256.     echo "Let's play with that file."
  257.     echo "First, a word count"
  258.     wc cut
  259.     echo "Next, 32 bit file CRC, then a Unix style checksum"
  260.     crc cut; sum cut
  261.     sleep 100
  262.     return
  263. cis        speed 1200 nolog 232-4026 sleep 20     : Compuserve via CIS
  264.     put \3
  265. cis:    pat 1 ID:; wait
  266.     put 70001,0001\r pat 1 assword:; wait; put "wrongo\r"
  267.     pat 1 OK; pat 2 Plex!; pat 3 "\nFunction: "; pat 4 "!"
  268.     wait
  269.     if n o return
  270.     pat; t -fcs!p
  271.     return
  272. cis24    speed 2400 nolog 222-2151    : Compuserve via Tymnet 2400 bps
  273.     pat 1i x; wait -f5 put A pat 1 "log in"; wait
  274.     put "cis02;"; goto cis
  275. cis02    speed 1200 nolog 222-0900    : Compuserve via Tymnet
  276.     pat 1i x; wait put A pat 1 "log in"; wait
  277.     put "\030cis02;" goto cis
  278. cisdat    speed 1200 %l-604-687-7144    : Compuserve via Datapac
  279.     sleep 25
  280.     ena -t
  281.     put "..\r"
  282.     pat 1 "DATAPAC"
  283.     wait -f4
  284.     put "P 29400138\r"
  285.     dis -t
  286.     pat 1 "Name:"
  287.     wait -f20
  288.     put "cis\r"
  289.     goto cis
  290. cistel    speed 1200 295-3028        : Compuserve via Telenet
  291.     on !c o abort
  292.     pat 1 TERMINAL
  293.     while !1 put "\r" wait -f1
  294.     pat 1 @
  295.     put "D1\r"; wait -f4
  296.     if !1 o abort
  297.     put "C 202202\r"
  298.     goto cis
  299.  
  300. navobsy        speed 1200 %l-202-653-1079 t -u7e
  301.     echo " type @tco for list of commands "
  302. nbs        speed 300 %l-301-948-5717 t
  303. nbs2        speed 300 %l-301-948-5718 t
  304. oem        speed 1200 %s8 pat 1i \5;wait;put \1;sb;o
  305. omen-tech    speed 1200 %s8 t
  306. pl24    speed 2400 241-0496 goto pl1    : People-Link via Telenet
  307. pl    speed 1200 295-3028        : People-Link via Telenet
  308. pl1:    patt; patt 1 TERMINAL
  309.     while !1 put "\r" wait -f1
  310.     pf40 patt 1 @
  311.     put "D1\r"; wait
  312.     if !1 o abort
  313.     put "set 0:33,64:1\r"; wait -f1
  314.     put "c 312 63\r"
  315.     pat 1 "PRESS <RETURN>:";  wait -f15;  put "\r"
  316.     pat 1 "ID:";  wait -f15;  put "myacct\r"
  317.     pat 1 "PASSWORD:";  wait -f15;  put "nothis\r"
  318.     set f9 "/next\r"; set f10 "/dlo;fil;xmo;\r\r"
  319.     t
  320. source1200    speed 1200 295-3028    : The Source via Telenet
  321. sourcex:    on !c o abort
  322.     set  f7 "upi n b "
  323.     set  f9 "upi n g "
  324.     set f8 ",-,*,rb"
  325.     set f10 ",-,*,sb"
  326.     pf3
  327.     patt; patt 1 TERMINAL
  328.     while "L<5&&!1" put "\r" wait -f1
  329.     if !1 off
  330.     pf40 patt 1 @
  331.     put "D1\r"; wait
  332.     if !1 o abort
  333.     put "c 30124\r"
  334.     kill; patt; patt 1 SOURCE; wait
  335.     if !1 o abort
  336.     putw "id ABC123 notthis\r"
  337.     patt; pat 10c "-More-" "@put \r lput \r\E[A\E[2M\E[A"
  338.     pf9999; wait
  339. source300    speed 300 295-3028    : The Source via Telenet
  340.     goto sourcex
  341. telegodzilla    speed 1200 %s8-3746
  342.     ena -Z; display overstrike; cls; pat 1 \n
  343.     while "!1&&c&&L<10" put \r wait -f1
  344.     if !1||!c echo "Access Failed"; o; return
  345.     pat 1 "ease:"; wait -f2
  346.     put "\b\b%s6 %s7\r"; pat 1 ect;wait -f2
  347.     put "y"; pat 1 "-Host"; wait -f5
  348.     if !forder putw "\b\bsz demo/order\r"
  349.     set s0 "TeleGodzilla"
  350. tele1:    echo "You are now Online to \42%s0\42."
  351.     echo "Type F1 when done."; t -Z!vn
  352.     lput "\Ez Do you wish to disconnect (y/n) "
  353.     if y echo " Disconnecting ... ";put \25\4; wait -f2; o; return
  354.     echo " **************  Rewinding the Capture Buffer  ************** "
  355.     rewind; wait -vf1; goto tele1
  356.  
  357. host    echo " host " speed 1200
  358.     set welcome welcome.txt
  359.     set password Ritchie
  360.     set challenge challeng.txt
  361.     set unrestrict "CustomerSupport"    : WARNING - CHANGE THIS!!
  362.     set xhelpfile xyamhelp.t
  363.     set private private; set messages messages
  364.     set emdir "."; set twxfile twx;
  365.     set call2 ATZ\r\336\336ATM1X1S0=1\r\336ATM1X1S0=1\r\336\336
  366.     set outahost "@pk512; putw ATM0H1\r"
  367.     set baudstr "@gosub baud"
  368.     pc40
  369.     return
  370.  
  371. sinit    pv0;  cls
  372.     echo "    Initial setup for ZCOMM with ZMODEM, WXMODEM, etc.        "
  373.     echo "             I need some phone information.                    "
  374.     accept s6 " Your \E[1mFirst\E[0m name please "
  375.     accept s7 " Your Last name please "
  376.     set s8 ""
  377. getac:    accept s8 " Please enter your 3 digit telephone area code, plus <Enter> "
  378.     if !%s8 goto getac
  379.     echo "I need local access numbers for the Compuserve Information Service."
  380.     if dd lput "Shall I search for them (y/n) ?"
  381.     if dd if y echo "300/1200 bps Access Numbers"; find "%s8 " cisnodes.lst
  382.     echo "Just hit <Enter> if your modem doesn't have the indicated speed."
  383.     accept s3 " Please enter the 1200 baud local Compuserve Node phone Number "
  384.     accept s2 " Please enter the 300 baud local Compuserve Node phone Number "
  385.     accept s5 " Please enter the 1200 baud local Tymnet Node phone Number "
  386.     accept s4 " Please enter the 1200 baud local Telenet Node phone Number "
  387.     echo "Creating disk file 'LOCAL.T' for future reference"
  388.     kill; pv0; create -y local.t
  389.     echof " :Area Code is \042%s8\042"
  390.     if %s2 echof " set s2 \042%s2\042"
  391.     if %s3 echof " set s3 \042%s3\042"
  392.     if %s4 echof " set s4 \042%s4\042"
  393.     if %s5 echof " set s5 \042%s5\042"
  394.     if %s6 echof " set s6 \042%s6\042"
  395.     if %s7 echof " set s7 \042%s7\042"
  396.     echof " set s8 1-503-621"
  397.     lput "\EzAre you using a Color Monitor? (y/n) "
  398.     if y echof " if dd&&dc ps4 pn3 pr97 pu6"; ps4 pn3 pr97 pu6
  399.     lput "\r\nIs your display adapter flicker/snow free? (y/n) "
  400.     if y echof " if dd&&dc display warpdrive"; display warpdrive
  401.     lput "\r\nDoes your modem include 2400 bps or higher? (y/n) "
  402.     if y echof " set mcommand \"gosub mm224\""; set mcommand "gosub mm224"
  403.     close; echo "file created"
  404.     if dd echo "Searching for directory entries with your area code"
  405.     if dd find l-%s8- %phones
  406.     if dd echo "Please change the %phones lines shown above to suit your area."
  407.     if !is8,503 return
  408.     kill; pv0; create -+ local.t
  409.     lput "Is 621-3746 (Burlington Exchange) a local call for you ? (y/n) "
  410.     if y echof " set s8 621"
  411.     else echof " set s8 1-621"
  412.     close; return
  413. quitt:    echo "   Type 'menu' to return to this menu   "
  414.     if !%f10 quit
  415.     echo "       Press F10 for Flash-Up Help      "
  416.     echo "\n\n  The following ABORT message is normal "
  417.     abort
  418. carrier    lput " Type \ESy\Eq if the modem on port \ET%s9\Eq is now connected to a computer: "
  419.     if y echo "OK, just checking"; sleep 30; set s9 "x"; return
  420.     lput " Is the Modem connected to Port 2 ? "
  421.     if y port 2; if !c lput "\r\n"; set s9 "y"; return
  422.     lput "\r\n\nAlthough ZCOMM can operarte with the modem's\r\n"
  423.     lput "Carrier Detect signal always on, this script (and most other\r\n"
  424.     lput "scripts) require the Carrier Detect signal to read the actual\r\n"
  425.     lput "modem status.  Please adjust the modem accordingly; on the Hayes\r\n"
  426.     lput "SmartModem 1200, switch 6 should be UP. "
  427.     off
  428. xdnum:    cls
  429.     if jmcommand,mm224 sp 2400; goto xd1
  430.     lput "Use 2400 Baud (y/n) ? "
  431.     if y speed 2400;  goto xd1
  432.     lput "Use 300 Baud (y/n) ? "
  433.     if y speed 300; goto xd1
  434.     speed 1200;  echo "1200 Baud, then."
  435. xd1:    accept telno "Enter Telephone Number: "
  436.     gosub dial
  437.     sets s0 "%telno"
  438.     goto tele1
  439. glocal:    cls;  display nonlmode
  440.     lput "Use Port 2 (y/n) ?"
  441.     if y port 2
  442.     else port 1
  443.     gosub askspd
  444.     set s0 "Local"
  445. tele9:    echo "You are now Online to %s0."
  446.     echo "Type F1 when done."; t -Z!v
  447.     lput "\Ez Do you wish to disconnect (y/n) "
  448.     if y echo "Be Sure to reset the Modem Port"; gosub ak;  return
  449.     echo " **************  Rewinding the Capture Buffer  ************** "
  450.     rewind; wait -f1; goto tele9
  451. order    if forder display overstrike; page order; return
  452.  cls display overstrike
  453.  lput "ZCOMM Registration, Typeset Manual Pages, ZSNP, and update disk sells for $40.00.\r\n"
  454.  lput "                 (Add $10 if you wish a PC-size binder)\r\n"
  455.  lput "\r\n"
  456.  lput "       Send check to Omen Technology, PO Box 4681, Portland OR 97208\r\n"
  457.  lput "\r\n"
  458.  return
  459. baud    pat 1 "CONNECT\r\n"; pat 2 "NO CARRIER"
  460.     pat 5 "CONNECT 1200\r\n"; pat 3 "CONNECT 2400\r\n"
  461.     pe-20
  462.     wait -Ef25
  463.     dis -E
  464.     if 1 speed 300 return
  465.     if 5 speed 1200 sleep 20 return
  466.     if 3 speed 2400 sleep 20 return
  467.     kill create -+ rings
  468.     close
  469.     fail
  470.  
  471. waketb    bye; br        : Wake up the modem, including TrailBlazer
  472.     pat 9 OK; ena -dt
  473.     if 9 goto wak1
  474.     while "!9&&L<3" put "ATZ\r"  wait -f1
  475.     if 9 goto wak1
  476.     if du sp 9600 echo "9600 bps"
  477.     if !du sp 19200 echo "19200 bps"
  478.     bye; br; br; br; while "!9&&L<2" put "ATZ\r"  wait -f1
  479.     while "!9&&L<10" put "AT\r"  wait -f1
  480.     if 9 goto wak1
  481.     echo "No response From MODEM" dis -Q
  482.     bye; sleep 4; br; br; while "!9&&L<2" put "ATZ\r"  wait -f2
  483.     if 9 goto wak1
  484.     echo "No response From MODEM"
  485.     bye; sleep 4; br; br; while "!9&&L<2" put "ATZ\r"  wait -f2
  486.     if 9 goto wak1
  487.     echo "No response From MODEM: setting 2400 bps"; sp 2400
  488.     bye; sleep 4; br; br; while "!9&&L<2" put "ATZ\r"  wait -f2
  489.     if 9 goto wak1
  490.     echo "No response From MODEM: setting 1200 bps"; sp 1200
  491.     while "!9&&L<20" o sleep 9 bye sleep 9 put "ATZ\r"  wait -f2
  492.     if 9 goto wak1
  493.     echo "No response From MODEM"
  494. wak1:    on
  495.     pat 9l OK
  496.     while "!9&&L<10" put "AT\r"  wait -f1
  497.     dis -t;  ret
  498. : This assumes a Hayes compatible modem set for extended result messages
  499. ::
  500. ::
  501. :: Alternate dial script for Multi Tech 224 modem uses speed fallback.
  502. ::  This also supports Telebit TrailBlazer modems.
  503. :: If the call is placed at > 300 bps, switch to 2400 bps.  Make the
  504. :: call.  If the called modem only supports 1200 or (ugh) 300 bps,
  505. :: the modem will drop back in speed.  The actual connect speed is indicated
  506. :: by a "CONNECT", "CONNECT 1200", or "CONNECT 2400" string.
  507. :: Fallback to 300 bps may be a bit messey, (depending on the answering
  508. :: modem, so a call originated at 300  bps will go out at that speed
  509. ::
  510. ::
  511. mm224    pat; :: if v<1 ena -Q
  512.     if "%telno<2" echo "Please do not use \"call mm224\""; abort
  513.     set s0 ""
  514.     if S<9500 goto mm225
  515.     set s0 "FAST"
  516.     set f5 "@put \25trailblazer\r wait -f5; sp 19200"
  517.     if du set f5 "@put \25trailblazer\r wait -f5; sp 9600"
  518.     echo "Press F5 to switch to high speed"
  519. mm225:    if S==450 set s0 "450"; sp 300 echo "300 bps"
  520.     else if "S<9500&&S>111" sp 2400 echo "2400 bps"
  521.     gosub waketb
  522.     if "du&&is0,FAST" putw "ATS51=4\r"; sp 9600    :Trailblazer i/f speed
  523.     else if "is0,FAST" putw "ATS51=5\r"; sp 19200
  524.     put "AT E1 Q0 S7=60 V1\r"; wait -f2
  525.     put "ATS6=3 X1 S8=1 S0=0\r" wait -f2
  526.     put %mprefix; put %telno\r; dis -Qdt
  527.     if "jtelno,;"  echo "Lift Telephone Receiver, Hit SPACE"; return
  528.     pat 1 "CONNECT\r"; pat 2i "NO CARRIER"; pat 3 "BUSY"; pat 4 RING;
  529.     pat 5 "ECT 12"; pat 6 "ECT 24"; pat 7 "CONNECT FAST"
  530.     pat 8 "NO DIAL TONE"; pat 10 "CONNECT 300"
  531.     wait -f60
  532.     while "4&&!L>3" wait -f20
  533.     if "1||10" if is0,450 sp 450; echo "450 bps"; pat; return
  534.     if "1||10" sp 300 pat; return
  535.     if 5 sp 1200 pat; return
  536.     if 6 sp 2400 pat; return
  537.     if "du&&7" sp 9600 echo "9600 bps"; pat; return
  538.     if 7 sp 19200 pat; return
  539.     if !9 bye
  540.     pat; o; fail
  541.     : inittb initializes the TrailBlazer NVRAM for these scripts
  542. inittb    sp 9600; ena -t; gosub waketb
  543.     putw "at&F s0=0 s50=0 s51=255 s52=1 s53=1 s54=1 s58=3 s68=3 &W\r\336\336"
  544.     return
  545. dialsx    pat : dial routine for Microcom SX/1200 modem
  546.     if "%telno<2" echo "Please do not use \"call dial\""; abort
  547.     bye; pat 1 "4"; ena -d; pq1
  548.     while "!1&&L<10" put "4" wait -f1
  549.     if !1 echo "No response From MODEM"; fail
  550.     pat 1i "!"
  551.     put "5"; wait -f1
  552.     put "se0\r"  ;wait -f1
  553.     put "sbrk1\r"  ;wait -f1
  554.     put "sf11\r"  ;wait -f1
  555.     put "sfm0\r"  ;wait -f1
  556.     put "sx1\r"  ;wait -f1
  557.     put "smaut\r"  ;wait -f1
  558.     put "s1p4\r"  ;wait -f1
  559.     put "s1c1\r"  ;wait -f1
  560.     pat 1 "CONNECT "; pat 2 "NO C"; pat 3 "IN USE"
  561.     putw "dp%telno\r"
  562.     wait -f80
  563.     dis -d
  564.     if 1 pat; return
  565.     pat; bye; fail
  566.  
  567.     :: Generate a script with TurboLearn Script Writer(TM)
  568. tlearn    set f30 "" :: telephone number, and flag that telno was entered
  569.     if c goto connected
  570.     cls
  571.     accept f30 "Enter Telephone Number "
  572. ag1:    accept f31 "Enter Speed (300, 1200, 2400) "
  573.     if if31,2400 speed 2400 goto ag2
  574.     if if31,1200 speed 1200 goto ag2
  575.     if if31,300 speed 300 goto ag2
  576.     echo "Bad speed"; goback ag1
  577. ag2:    lput "\r\n1    System uses IBM PC (ANSI) line drawing characters\r\n"
  578.     lput "2    System uses 7 bits even parity\r\n"
  579.     lput "3    System uses 8 bits No parity (8n1)\r\n"
  580.     lput "\r\n"
  581.     acceptl1 f32 "Choose one of the above: "
  582.     lput "\r\n"
  583.     ena -8n
  584.     @%f30
  585.     if !c echo "Sorry, no connection"; return
  586.     set f35 ""
  587.     if if32,1 ena -8g; set f35 "ena -8g"
  588.     if if32,2 ena -7e; set f35 "ena -7e"
  589. connected:
  590.     echo "Finish with F1.  Use ALT-B to send a break if necessary"
  591.     learn -y tlrn.tmp
  592. cn2:    if !r echo "WARNING: Learning (recording) terminated prematurely!"
  593.     close
  594.     kill
  595.     create newscr.t
  596.     if !r abort
  597.     echo "Is this to become a Telephone Directory entry (y/n)?"
  598.     if !y goto nodir
  599.     accept f36 "What directory entry name to use? "
  600.     echoc "%f36    speed %f31 %f30 %f35"
  601. nodir:    close;  set f32 ""
  602.     echo "Should the script disconnect the phone line (y/n) ?"
  603.     if !y "!tlearn tlrn.tmp >>newscr.t"; goto scdone
  604.     set f32 "bye;  return"
  605.     echo "Should the script then exit to the Operating System (y/n)?"
  606.     if y  set f32 "off"
  607.     !tlearn -r tlrn.tmp >>newscr.t
  608.     create -+ newscr.t; echof "    %f32";  close
  609. scdone:    echo "Your new script is in the file 'newscr.t' !!"
  610.     if %f30 echo "You may add this file to your Telephone Directory"
  611.     if %f30 echo "Or execute it with 'call %f36.newscr.t'";  return
  612.     echo "You may execute this file with 'source newscr.t'"
  613.     return
  614.  
  615.